﻿using System;
namespace Localization.Repository.Models
{
    public class ResourceKey
    {
        private string _name;

        //#region constructors

        ///// <summary>
        ///// Initializes a new instance of the <see cref="ResourceKey"/> class.
        ///// </summary>
        //public ResourceKey() { }
        ///// <summary>
        ///// Initializes a new instance of the <see cref="ResourceKey"/> class.
        ///// </summary>
        ///// <param name="keyName">Name of the resource key.</param>
        ///// <param name="classKey">The class key.</param>
        ///// <param name="comment">The comment.</param>
        //public ResourceKey(string keyName, ResourceClassKey classKey, string comment)
        //    :this(0, keyName, classKey, comment)
        //{
        //}

        //public ResourceKey(int id, string keyName, ResourceClassKey classKey, string comment)
        //{
        //    this.ResourceKeyID = id;
        //    this.Name = keyName;
        //    this.ClassKey = classKey;
        //    this.Comment = comment;
        //}

        //#endregion

        #region public properties

        /// <summary>
        /// Gets or Sets the resource key ID.
        /// </summary>
        public virtual int ResourceKeyID { get; set; }
        /// <summary>
        /// Gets or sets the resource key name.
        /// </summary>
        /// <value>The name.</value>
        public virtual string Name
        {
            get { return _name; }
            set
            {
                if (value.Length > 255)
                    throw new ArgumentOutOfRangeException("Name", "Resource key name cannot exceed 255 characters.");
                _name = value;
            }
        }
        /// <summary>
        /// Currently not used.  If used it would 
        /// be for distiguishing between different resource types.
        /// For example, there might be text resources, or image url resources
        /// so classkey would create some containment for like items.
        /// </summary>
        public virtual ResourceClassKey ClassKey { get; set; }

        public int ResourceClassKeyID { get; set; }

        ///// <summary>
        ///// Gets or Sets the value of the resource text for this resource key.
        ///// </summary>
        //public virtual string ResourceValue { get; set; }
        /// <summary>
        /// Gets or Sets the definition or comment which
        /// resource is used in.  Comment is used to help
        /// tranlators understand the usage of the word, phrase, etc.
        /// </summary>
        public virtual string Comment { get; set; }

        #endregion
    }
}
